package com.wlz.authorization.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;

@RestController
@RequestMapping("/admin/secured")
public class AdminSecuredController {

    @Secured("ROLE_admin")
    @GetMapping("/demo")
    public String demo() {
        return "spring security demo";
    }

}